package unit7;

import java.util.ArrayList;

public class IntList {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 5; i <= 11; i++) {
            list.add(i);
        }
        System.out.println("列表中的元素有：" + list);
        System.out.println();

        // remove 5th element
        System.out.println("删除第5个元素: " + list.remove(5));
        System.out.println("列表中的元素有：" + list);
        System.out.println();

        // remove 5
        Integer five = 5;
        System.out.println("删除元素5: " + list.remove(five));
        System.out.println("列表中的元素有：" + list);
    }
}
